package ink.xiaobaibai.entity;

import com.baomidou.mybatisplus.annotation.*;
import ink.xiaobaibai.valited.UpdateGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author xiaobaibai
 * @since 2021-06-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("buy_oxygen_device")
public class BuyOxygenDevice implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 氧气机主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(groups = UpdateGroup.class)
    private Integer id;

    /**
     * 机器码
     */
    @TableField("device_code")
    @NotNull
    @NotNull(groups = UpdateGroup.class)
    private String deviceCode;

    /**
     * 管理者id
     */
    @TableField("admin_user_id")
//    @Null
//    @Null(groups = UpdateGroup.class)
    private Integer adminUserId;

    /**
     * 管理者部门id
     */
    @TableField("dep_id")
    @Null
    @Null(groups = UpdateGroup.class)
    private Integer depId;

    /**
     * 客户id
     */
    @TableField("client_user_id")
    @Null
    @Null(groups = UpdateGroup.class)
    private Integer clientUserId;

    /**
     * 延时时间
     */
    @TableField("delayed_time")
    @NotNull
    @Min(1)
    @NotNull(groups = UpdateGroup.class)
    @Min(value = 1, groups = UpdateGroup.class)
    private Integer delayedTime;

    /**
     * 风扇时间
     */
    @TableField("fan_time")
    @NotNull
    @Min(1)
    @NotNull(groups = UpdateGroup.class)
    @Min(value = 1, groups = UpdateGroup.class)
    private Integer fanTime;

    /**
     * 阀门时间
     */
    @TableField("valve_time")
    @NotNull
    @Min(1)
    @NotNull(groups = UpdateGroup.class)
    @Min(value = 1, groups = UpdateGroup.class)
    private Integer valveTime;

    /**
     * 机器型号
     */
    @TableField("type")
    private String type;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;


}
